﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

// NotReviewedButNeeded
#pragma once

#include "IElement.h"
#include "ElementCreationOptions.h"

namespace gcmp
{
    class Coordinate3d;

    /// \brief 矩形板
    ///
    /// 矩形板，通过此类可以创建矩形板
    class GCMP_MODEL_INTERFACE_EXPORT IRectangleBoard : public IElement
    {
        DEFINE_CAST_DERIVED(gcmp::IRectangleBoard, gcmp::IElement);
    public:
        /// \brief 析构函数
        virtual ~IRectangleBoard();

#pragma region Static
        /// \brief 创建矩形板
        ///
        /// \param pDocument 矩形板的所属的文档
        /// \param associatedPlaneId 矩形板关联平面Id
        /// \param position 矩形板的位置
        /// \param directionX 矩形板的X轴方向
        /// \param directionY 矩形板的Y轴方向
        /// \param width 矩形板的宽度
        /// \param height 矩形板的高度
        /// \param eco 矩形板的元素创建选项
        /// \return 返回所创建的矩形板指针
        static IRectangleBoard* Create(IDocument* pDocument, const ElementId &associatedPlaneId, const Vector3d &position,
            const Vector3d &directionX, const Vector3d &directionY, double width, double height,
            ElementCreationOptions eco = ElementCreationOptions::Normal);
#pragma endregion Static

        /// \brief 获取矩形板的局部坐标系
        /// \return 返回矩形板的局部坐标系
        virtual Coordinate3d GetCoordinate()const = 0;

        /// \brief 获取矩形板宽度
        /// \return 返回矩形板宽度
        virtual double GetWidth()const = 0;
        /// \brief 设置矩形板宽度
        /// \param width 宽度
        /// \return true-设置成功，false-设置失败
        virtual bool SetWidth(double width) = 0;

        /// \brief 获取矩形板高度
        /// \return 返回矩形板高度
        virtual double GetHeight()const = 0;
        /// \brief 设置矩形板高度
        /// \param height 高度
        /// \return true-设置成功，false-设置失败
        virtual bool SetHeight(double height) = 0;

        /// \brief 获取矩形板用于渲染的材质Id
        /// \return 返回矩形板用于渲染的材质Id
        virtual ElementId GetGraphicsMaterialId()const = 0;
        /// \brief 设置矩形用于渲染的材质Id
        /// \param materialId 材质Id
        /// \return true-设置成功，false-设置失败
        virtual bool SetGraphicsMaterialId(const ElementId& materialId) = 0;

        /// \brief 获取矩形板的背面可见性
        /// \return true-背面可见，false-背面不可见
        virtual bool IsBackFaceVisible()const = 0;
        /// \brief 设置矩形板的背面可见性
        /// \param backFaceVisible 矩形板的背面可见性
        /// \return true-设置成功，false-设置失败
        virtual bool SetIsBackFaceVisible(bool backFaceVisible) = 0;

        /// \brief 获取渲染纹理时是否对矩形板进行纹理坐标归一化处理
        /// \return true-进行纹理坐标归一化，false-不进行纹理坐标归一化
        virtual bool IsTextureCoordinateNormalized()const = 0;
        /// \brief 设置渲染纹理时是否对矩形板进行纹理坐标归一化处理
        /// \param textureCoordinateNormalized 是否归一化
        /// \return true-设置成功，false-设置失败
        virtual bool SetIsTextureCoordinateNormalized(bool textureCoordinateNormalized) = 0;

    public:
        /// \brief 获取Implementation Uid
        ///
        /// \return UniIdentity 返回ImplementationUid
        static UniIdentity GetImplementationUid();
    };
}


